
def permu(num = 5, base = (200, 100, 50, 20, 10, 5, 2, 1), comment = ''):
    if len(base) == 1:
        # print comment + '%d * %d' % (base[0], num / base[0])
        return 1
    t = 0
    for i in range(num / base[0] + 1):
        t += permu(num - base[0] * i, base[1:], comment + '%d * %d ' % (base[0], i))
    return t

print permu(200)
    